package com.then.component.message.ui;

import android.support.annotation.Nullable;
import android.os.Bundle;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;

import com.luojilab.component.componentlib.router.ui.UIRouter;
import com.then.component.message.R;
import com.then.component.message.ui.base.MessageModuleFragment;


/**
 * A placeholder fragment containing a simple view.
 */
public class MessageContainerFragment extends MessageModuleFragment<MessageContainerDelegate> {

    public MessageContainerFragment() {

    }

    @Nullable
    @Override
    public View onCreateView(LayoutInflater inflater, ViewGroup container, Bundle savedInstanceState) {
        return super.onCreateView(inflater, container, savedInstanceState);
    }

    @Override
    protected Class<MessageContainerDelegate> getDelegateClass() {
        return MessageContainerDelegate.class;
    }

    @Override
    protected void bindEvenListener() {
        super.bindEvenListener();
        viewDelegate.setOnClickListener(this, R.id.tv_club, R.id.tv_contacts, R.id.tv_group);
    }

    @Override
    public void actionViewModel(View view, Object o, int actionType) {
        int id = view.getId();
        if (id == R.id.tv_club) {
            toClubList();
        } else if (id == R.id.tv_contacts) {

        } else if (id == R.id.tv_group) {

        }
    }

    private void toClubList() {
        Bundle bundle = new Bundle();

        UIRouter.getInstance().openUri(getActivity(), "DDComp://club/clubListPage", bundle);
    }

}
